Skip to content

fix(help): give every selector key a rule and list every selector command - #5028

Merged
thymikee merged 2 commits into
callstack:mainfrom
imranbarbhuiya:fix/help-selectors-followups
Nov 23, 2026
Merged

thymikee merged 2 commits into
callstack:mainfrom
imranbarbhuiya:fix/help-selectors-followups

Conversation

@imranbarbhuiya

@imranbarbhuiya imranbarbhuiya commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #5009, from its review notes.

  • Shape: a term is key=value or a bare boolean key (checked means checked=true).
  • Keys: appname and windowtitle say what they match and which snapshots report them: Linux, the macOS desktop, frontmost-app and menubar surfaces, and macOS app sessions on the native backend. checked states its three values: checked=true and checked=false match only an explicit state; mixed or absent match neither.
  • Commands: the list adds gesture pinch (feat(gesture): pinch an element by ref or selector #4998) and screenshot --crop-on. selectors.md also adds click, hover and gesture drag.
  • Test: cli-help-selectors.test.ts parses every agent-device example selector in the topic and selectors.md. Nine rule examples (bare key, escaped quote, button="Save" rejected, whole-field match, both checked values, || order) must appear in both texts and get the expected parser or matcher result. Every parser key must open a rule clause in the topic's Matching section and have a table row or Boolean keys entry in selectors.md. The prose around an example is not checked.

Before / after

$ agent-device help selectors   (lines that differ)
base aecafaf30:
  ... is, wait, scroll --until, and gesture drag accept a selector wherever they accept an @ref; ...
  One or more key=value terms separated by spaces. ...
  Boolean keys take true or false, and a bare key means true: visible=false, editable=true, checked.
head:
  ... and gesture pinch as the element to pinch. find takes one as its query, and scroll --until and screenshot --crop-on as the flag value.
  One or more terms separated by spaces. ... A term is key=value, or a boolean key alone, which means key=true: checked is checked=true. ...
  appname and windowtitle are the owning app's name and window title. Linux snapshots and the macOS desktop, frontmost-app, and menubar surfaces report them; ...
  checked tests a switch, checkbox, or radio. checked=true matches only an explicitly checked control and checked=false only an explicitly unchecked one; ...

Validation

  • check:affected --run --head 23d94bfc7: format, lint, typecheck, layering, fallow, build and vitest-related pass. check:doc-links and check:doc-prose pass.
  • The new test fails 3 of 13 against the base topic and docs. Fourteen parser, matcher and text mutants each fail it.

Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff

…mand

A term can be a bare boolean key, checked is three-valued, appname and windowtitle say which snapshots report them, and the command lists add gesture pinch and screenshot --crop-on (selectors.md also adds click, hover and gesture drag).
@thymikee

Copy link
Copy Markdown
Member

Thanks for the clear fix. At 23d94bf the code looks ready to merge, and no conflicts were reported. The only checks not passing are two Body rules jobs. Both were cancelled rather than failed, and the diff touches no body-check script or workflow file, so they look unrelated and a re-run should settle them. Not blocking, and fine to take or leave: the list of selector-taking commands is hand-written in two places with no test tying it to the command surface, the checked rule-example row asserts a substring that any selector text contains, and the appname/windowtitle surface note is duplicated in the help topic and the docs. Not verified here: the new test, the mutants and check:affected were not run, and a live snapshot on a macOS app session was not run, so the XCTest claim for appname/windowtitle rests on reading the source. Merge needs only the Body rules re-run.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 23, 2026
@thymikee
thymikee merged commit 6e2c53f into callstack:main Nov 23, 2026
16 of 18 checks passed
@imranbarbhuiya
imranbarbhuiya deleted the fix/help-selectors-followups branch November 23, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants